package com.lpy.service;

import com.lpy.spring.Component;
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @Description:
 * @author: LiuPengYu
 * @date 2024/11/16 16:29
 */
public class MyInterceptor implements MethodInterceptor {
    @Override
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy proxy) throws Throwable {
        System.out.println("执行方法前的操作");
        proxy.invokeSuper(o,objects);
        System.out.println("执行方法后的操作");
        return proxy;
    }
}
